// PcmRender.h: interface for the CPcmRender class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PCMRENDER_H__52676578_7FAB_4AA3_B865_004B8F014CD8__INCLUDED_)
#define AFX_PCMRENDER_H__52676578_7FAB_4AA3_B865_004B8F014CD8__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "AudioOutput.h"
#include "hw_lib.h"


#include <windows.h>
#include <mmsystem.h>
#include <vector>
using namespace std;
#define BUFFER_COUNTER 10

typedef struct 
{
	Packet packet;
	WaveHead waveheader;
}AudioBuffer;
class CPcmRender:public CAudioOutput  
{
public:
	
	
	
	CPcmRender();
	virtual ~CPcmRender();

	virtual int Init();
	virtual int Render(Packet*pPacket);
	virtual int close();
	virtual int flush();
	

	static void WaveOutputProc(HWAVEIN hwi, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 );
	void SendDataToDevice();
	
	Packet* Pop();
	int Push(Packet*p);

protected:




	AVOutputStatus m_Status;
	AVOutputParam  m_Param;

	HWAVEOUT handle;
	vector<AudioBuffer*> AudioDateBuffer;	
	
	void*	Event;
	void*	Critical;

};

#endif // !defined(AFX_PCMRENDER_H__52676578_7FAB_4AA3_B865_004B8F014CD8__INCLUDED_)
